<!--
 * @Author: lizhijie429
 * @Date: 2021-08-10 18:30:17
 * @LastEditors: lizhijie429
 * @LastEditTime: 2021-09-14 18:25:47
 * @Description: 
-->
<template>
  <div>
    <h1>Home</h1>
    <div>store中存在了一个数据 {{ count }}</div>
    <n-button type="primary" @click="increment">点击加1</n-button>
  </div>
</template>

<script setup lang="ts">
import { useStore } from "vuex";
import { key } from "../../store/index";
import { computed } from "vue";
const store = useStore(key);
const count = computed(() => {
  return store.state.count;
});
const increment = () => {
  store.commit("increment");
};
</script>

<style lang="scss" scoped></style>
